Reverse String in C
Reversing a string in C is a fundamental operation that involves rearranging the characters in a string so that the last character becomes the first, the second-to-last character becomes the second, and so on....
read more
C Program For Int to Char Conversion
To convert the int to char in C language, we will use the following 2 approaches:...
read more
C Program For Inserting A Node In A Linked List
We have introduced Linked Lists in the previous post. We also created a simple linked list with 3 nodes and discussed linked list traversal.All programs discussed in this post consider the following representations of the linked list....
read more
C Library Functions
The Standard Function Library in C is a huge library of sub-libraries, each of which contains the code for several functions. In order to make use of these libraries, link each library in the broader library through the use of header files. The definitions of these functions are present in their respective header files. In order to use these functions, we have to include the header file in the program. Below are some header files with descriptions:...
read more
C program to find the maximum and minimum element of the array
Given an array arr[] of N integers, the task is to write the C program to find the maximum and minimum element of the given array iteratively and recursively. Examples:...
read more
Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()
Since C is a structured language, it has some fixed rules for programming. One of them includes changing the size of an array. An array is a collection of items stored at contiguous memory locations....
read more
Bit Magic C/C++ Programs
Bit manipulation, also known as bit magic is the process of using bit-level operations to manipulate individual bits of a number. It uses bitwise operators such as AND, OR, XOR, right shift, etc. to manipulate, set, and shift the individual bits. This is used to improve the efficiency of our program and provide compact code....
read more
Lambda expression in C++
C++ 11 introduced lambda expressions to allow inline functions which can be used for short snippets of code that are not going to be reused and therefore do not require a name. In their simplest form a lambda expression can be defined as follows:...
read more
Pass Array to Functions in C
In C, the whole array cannot be passed as an argument to a function. However, you can pass a pointer to an array without an index by specifying the array’s name....
read more
Is it fine to write void main() or main() in C/C++?
In C/C++ the default return type of the main function is int, i.e. main() will return an integer value by default. The return value of the main tells the status of the execution of the program. The main() function returns 0 after the successful execution of the program otherwise it returns a non-zero value....
read more
When do we use Initializer List in C++?
Initializer List is used in initializing the data members of a class. The list of members to be initialized is indicated with constructor as a comma-separated list followed by a colon. Following is an example that uses the initializer list to initialize x and y of Point class....
read more
Difference between exit() and break in C/C++
In this article, the topic is to understand the difference between exit() and break....
read more